<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>唐诗背诵记录 - 记忆系统</title>
    <style>
        :root {
            --primary-color: #007AFF;  /* iOS 系统蓝 */
            --background-color: #F5F5F7;  /* 苹果浅灰背景 */
            --card-background: rgba(255, 255, 255, 0.9);  /* 毛玻璃效果基底 */
            --border-color: #E0E0E0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont,
            "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
            sans-serif;
            background-color: var(--background-color);
            margin: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem;
        }

        .container {
            background: var(--card-background);
            backdrop-filter: blur(10px);  /* 毛玻璃效果 */
            border-radius: 18px;  /* iOS风格圆角 */
            padding: 2rem;
            width: 100%;
            max-width: 600px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05),
            0 1px 3px rgba(0, 0, 0, 0.05);
            border: 1px solid var(--border-color);
        }

        h1 {
            color: #1D1D1F;
            font-weight: 600;
            font-size: 1.8rem;
            margin: 0 0 2rem 0;
            text-align: center;
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        label {
            display: block;
            margin-bottom: 0.5rem;
            color: #3A3A3C;
            font-size: 0.9rem;
            font-weight: 500;
        }

        input[type="text"] {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid var(--border-color);
            border-radius: 12px;  /* iOS输入框圆角 */
            font-size: 1rem;
            transition: all 0.2s ease;
            background: rgba(255, 255, 255, 0.8);
        }

        input[type="text"]:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);  /* iOS风格焦点光晕 */
        }

        .submit-btn {
            background: linear-gradient(to bottom, #007AFF, #0063CC);  /* iOS按钮渐变 */
            color: white;
            border: none;
            border-radius: 12px;
            padding: 1rem 2rem;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
        }

        .submit-btn:hover {
            opacity: 0.9;
            transform: scale(0.98);
        }

        .submit-btn:active {
            opacity: 0.85;
            transform: scale(0.96);
        }

        /* iOS风格加载动画 */
        .loading {
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 响应式设计 */
        @media (max-width: 640px) {
            body {
                padding: 1rem;
            }
            .container {
                border-radius: 12px;
                padding: 1.5rem;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <h1>📖 唐诗背诵记录</h1>
    <form th:action="@{/submit}" method="post" id="poemForm">
        <div class="form-group">
            <label for="poemTitle">诗篇标题</label>
            <input type="text"
                   id="poemTitle"
                   th:field="*{poemTitle}"
                   placeholder="请输入唐诗标题"
                   required>
        </div>
        <button type="submit" class="submit-btn" id="submitBtn">
            <span>提交记录</span>
        </button>
    </form>
</div>

<script>
    // 添加提交动画
    document.getElementById('poemForm').addEventListener('submit', (e) => {
        const btn = document.getElementById('submitBtn');
        btn.innerHTML = `<div class="loading"></div>`;
        btn.disabled = true;
    });
</script>
</body>
</html>